import { createRouter, createWebHashHistory } from 'vue-router'

import AppView from './App.vue'

const routes = [
  {
    path: '/',
    component: AppView,
    children: [
      {
        path: '',
        name: 'HomePage',
        meta: { title: '首页' },
        component: () => import('@/views/HomeView.vue')
      },
      {
        path: 'dialog',
        name: 'dialog',
        meta: { title: '弹窗' },
        component: () => import('@/views/Dialog/Index.vue')
      },
      {
        path: 'dialog/imageView',
        name: 'image-view',
        meta: { title: '图片预览' },
        component: () => import('@/views/Dialog/ImageView/index.vue')
      },
      {
        path: 'input',
        name: 'input',
        meta: { title: '输入框' },
        component: () => import('@/views/Input/index.vue')
      },
      {
        path: 'svg',
        name: 'svg',
        meta: { title: 'svg图标' },
        component: () => import('@/views/SVG/Index.vue')
      },
      {
        path: 'select',
        name: 'select',
        meta: { title: '选择器' },
        component: () => import('@/views/Select/index.vue')
      },

      {
        path: 'message',
        name: 'message',
        meta: { title: '消息提示' },
        component: () => import('@/views/Message/Index.vue')
      },
      {
        path: 'table',
        name: 'table',
        meta: { title: '表格' },
        component: () => import('@/views/Table/Index.vue')
      },
      {
        path: 'switch',
        name: 'switch',
        meta: { title: '开关' },
        component: () => import('@/views/Switch/index.vue')
      },
      {
        path: 'pagination',
        name: 'pagination',
        meta: { title: '分页' },
        component: () => import('@/views/Pagination/index.vue')
      },
      {
        path: 'carousel',
        name: 'carousel',
        meta: { title: '轮播图' },
        component: () => import('@/views/Carousel/index.vue')
      },
      {
        path: 'button',
        name: 'button',
        meta: { title: '按钮' },
        component: () => import('@/views/Button/Index.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
export { routes }
